<template>
  <div class="reportFormPage">
    <div class="report-dom">
      <el-row>
        <el-col :span="5" :offset="19">
          <div class="pageNumBox">
            <span>第</span>
            <span class="placeholder-min text-center">&nbsp;{{ form.page }}&nbsp;</span>
            <span>页，共</span>
            <span class="placeholder-min text-center">&nbsp;{{ form.totalPage }}&nbsp;</span>
            <span>页</span>
          </div>
        </el-col>
      </el-row>
      <div class="topTwoBox">
        <div class="centerName">水泥标准稠度用水量、凝结时间、安定性试验检测记录表</div>
        <div class="codeText">
          <tr>
            JGLQ04003
          </tr>
          <tr>
            JGLQ04004
          </tr>
          <tr>
            JGLQ04005
          </tr>
        </div>
      </div>
      <div class="threeTopBox">
        <div class="left-border">
          <div class="box-title">检测单位名称：</div>
          <div class>{{ form.jiancdwmc }}</div>
        </div>
        <div class="right-border">
          <span>记录编号：</span>
          <span v-if="isPdf" class="placeholder">{{ form.jilbh }}</span>
          <el-input class="code-input" v-else type="text" v-model="form.jilbh" @focus="handleFocus('jilbh')" />
        </div>
      </div>
      <div class="table-border">
        <!------------------------------表头-------------------------->
        <table height="220px" class="top-table">
          <tbody>
            <tr>
              <td height="30" align="center" width="15%">
                <span style="width: 90px; display: inline-block">工程名称</span>
              </td>
              <td width="35%" class="text-center">
                <span>{{ form.gongcmc }}</span>
              </td>
              <td align="center" width="15%">
                <span style="width: 90px; display: inline-block">工程部位/用途</span>
              </td>
              <td width="35%" class="text-center">
                <span>{{ form.gongcbwyt }}</span>
              </td>
            </tr>
            <tr>
              <td height="50" align="center">样品信息</td>
              <td class="specimen-border" colspan="3">
                <span>样品名称：</span>
                <span :class="{ placeholder: !form.yangpmc }">{{ form.yangpmc }}</span>
                <span>；样品编号：</span>
                <span :class="{ 'placeholder-long': !form.yangpbh }">{{ form.yangpbh }}</span>
                <span>；样品数量：</span>
                <span :class="{ placeholder: !form.yangpsl }">{{ form.yangpsl }}</span>
                <span>；样品状态：</span>
                <span :class="{ placeholder: !form.yangpzt }">{{ form.yangpzt }}</span>
                <span>；来样时间：</span>
                <span :class="{ placeholder: !form.yangpsj }">{{ form.yangpsj }}</span>
              </td>
            </tr>

            <tr>
              <td height="25" align="center" width="15%">
                <span style="width: 90px; display: inline-block">试验检测日期</span>
              </td>
               <!-- <td width="35%" class="text-center">{{ form.shiyjcrq }}</td> -->                                            
 <td width="35%" class="text-center">
      <el-input v-model="form.shiyjcrq" />
</td>
              <td align="center" width="15%">
                <span style="width: 90px; display: inline-block">试验条件</span>
              </td>
              <td v-if="isPdf" width="35%">
                温度：
                <span style="display: inline-block; width: 10%">{{ form.shiytjwd }}</span>
                ℃；湿度：
                <span style="display: inline-block; width: 10%">{{ form.shiytjsd }}</span
                >%RH
              </td>
              <td v-else width="35%">
                温度：
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.shiytjwd" style="width: 15%" />
                ℃；湿度：
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.shiytjsd" style="width: 15%" />
                %RH
              </td>
            </tr>

            <tr>
              <td height="50" align="center" width="15%">
                <span style="width: 90px; display: inline-block">检测依据</span>
              </td>
              <td width="35%">
                <span v-if="isPdf">{{ form.jiancyj }}</span>
                <el-input v-else type="textarea" v-model="form.jiancyj" :rows="2" class="mark" @dblclick.native="showBsJiancyjView" readonly />
              </td>
              <td align="center" width="15%">
                <span style="width: 90px; display: inline-block">判定依据</span>
              </td>
              <td width="35%">
                <span v-if="isPdf">{{ form.pandyj }}</span>
                <el-input v-else type="textarea" v-model="form.pandyj" :rows="2" @dblclick.native="showBsJudgeBaseView" @focus="handleFocus('pandyj')" class="mark" />
              </td>
            </tr>
            <tr class="bottom-border">
              <td height="50" align="center">
                <div>主要仪器设备</div>
                <div>名称及编号</div>
              </td>
              <td colspan="3">
                <span v-if="isPdf">{{ form.zhuyyqsbmcjbh }}</span>
                <el-input v-else type="textarea" :rows="2" v-model="form.zhuyyqsbmcjbh" class="height100 width100 mark" @dblclick.native="showBsInstrumentView" readonly></el-input>
              </td>
            </tr>
          </tbody>
        </table>
        <!------------------------------表中-------------------------->
        <table height="616px" class="middle-table">
          <tbody>
            <tr height="25">
              <td rowspan="3">标准稠度用水量</td>
              <td colspan="2">测定方法</td>
              <td colspan="11">标准法</td>
            </tr>
            <tr height="40">
              <td colspan="3">
                试样质量
                <br />(g)
              </td>
              <td colspan="3">
                加水量
                <br />(ml)
              </td>
              <td colspan="4">
                试杆下沉距底部距离
                <br />(mm)
              </td>
              <td colspan="3">
                标准稠度用水量
                <br />(%)
              </td>
            </tr>
            <tr height="25">
              <td colspan="3">
                <el-input type="number" v-model="form.biaozcdyslsyzl" @keydown.native="handleKeyDown($event, 0, 0)" @paste.native="handlePaste($event, 0, 0)" :ref="'0_0'" />
              </td>
              <td colspan="3">
                <el-input type="number" v-model="form.biaozcdysljsl" @change="calculateYsl()" @keydown.native="handleKeyDown($event, 0, 1)" @paste.native="handlePaste($event, 0, 1)" :ref="'0_1'" />
              </td>
              <td colspan="4">
                <el-input type="number" v-model="form.biaozcdyslsgxcdbjl" @keydown.native="handleKeyDown($event, 0, 2)" @paste.native="handlePaste($event, 0, 2)" :ref="'0_2'" />
              </td>
              <td colspan="3">
                <el-input type="number" v-model="form.biaozcdyslbzcdysl" disabled />
              </td>
            </tr>
            <tr height="25">
              <td width="5%" rowspan="6">凝结时间</td>
              <td colspan="3">测定方法</td>
              <td colspan="3">标准法</td>
              <td colspan="4">开始加水时间(h:min)</td>
              <td colspan="3">
                <!-- <el-time-picker
                  class="hide-icon"
                  style="width: 100%"
                  :picker-options="{ selectableRange: '00:00:00-23:59:00' }"
                  format="HH:mm"
                  value-format="HH:mm"
                  v-model="form.ningjsjksjssj"
                  @change="handleStartTime"
                /> -->
                <el-input type="text" v-model="form.ningjsjksjssj" @change="handleStartTime" />
              </td>
            </tr>
            <tr height="60">
              <td width="5%" rowspan="2">初凝测定</td>
              <td width="10%">
                测试
                <br />时间 <br />(h:min)
              </td>
              <td style="width: calc(80% / 11 * 1)">
                <el-input v-model="form.chuncdsj1" @change="handleTimeSInput(0, form.chuncdsj1)" />
                <!-- <el-time-picker
                  class="hide-icon"
                  style="width: 100%"
                  :picker-options="{ selectableRange: '00:00:00-23:59:00' }"
                  format="HH:mm"
                  value-format="HH:mm"
                  v-model="form.chuncdsj1"
                  @change="handleTimeS(0, form.chuncdsj1)"
                  @paste.native="handlePasteTwo($event, 0, 0)"
                /> -->
                <!-- <el-time-picker  class="hide-icon" style="width:100%;" :picker-options="{selectableRange: '00:00:00-23:59:00'}" format="HH:mm" value-format="HH:mm" v-model="form.chuncdsj1" /> -->
              </td>
              <td style="width: calc(80% / 11 * 1)">
                <el-input v-model="form.chuncdsj2" @change="handleTimeSInput(1, form.chuncdsj2)" />

                <!-- <el-time-picker
                  class="hide-icon"
                  style="width: 100%"
                  :picker-options="{ selectableRange: '00:00:00-23:59:00' }"
                  format="HH:mm"
                  value-format="HH:mm"
                  v-model="form.chuncdsj2"
                  @change="handleTimeS(1, form.chuncdsj2)"
                  @paste.native="handlePasteTwo($event, 0, 1)"
                /> -->
              </td>
              <td style="width: calc(80% / 11 * 1)">
                <el-input v-model="form.chuncdsj3" @change="handleTimeSInput(2, form.chuncdsj3)" />
                <!-- <el-time-picker
                  class="hide-icon"
                  style="width: 100%"
                  :picker-options="{ selectableRange: '00:00:00-23:59:00' }"
                  format="HH:mm"
                  value-format="HH:mm"
                  v-model="form.chuncdsj3"
                  @change="handleTimeS(2, form.chuncdsj3)"
                  @paste.native="handlePasteTwo($event, 0, 2)"
                /> -->
              </td>
              <td style="width: calc(80% / 11 * 1)">
                <el-input v-model="form.chuncdsj4" @change="handleTimeSInput(3, form.chuncdsj4)" />
                <!-- <el-time-picker
                  class="hide-icon"
                  style="width: 100%"
                  :picker-options="{ selectableRange: '00:00:00-23:59:00' }"
                  format="HH:mm"
                  value-format="HH:mm"
                  v-model="form.chuncdsj4"
                  @change="handleTimeS(3, form.chuncdsj4)"
                  @paste.native="handlePasteTwo($event, 0, 3)"
                /> -->
              </td>
              <td style="width: calc(80% / 11 * 1)">
                <el-input v-model="form.chuncdsj5" @change="handleTimeSInput(4, form.chuncdsj5)" />

                <!-- <el-time-picker
                  class="hide-icon"
                  style="width: 100%"
                  :picker-options="{ selectableRange: '00:00:00-23:59:00' }"
                  format="HH:mm"
                  value-format="HH:mm"
                  v-model="form.chuncdsj5"
                  @change="handleTimeS(4, form.chuncdsj5)"
                  @paste.native="handlePasteTwo($event, 0, 4)"
                /> -->
              </td>
              <td style="width: calc(80% / 11 * 1)">
                <el-input v-model="form.chuncdsj6" @change="handleTimeSInput(5, form.chuncdsj6)" />
                <!-- <el-time-picker
                  class="hide-icon"
                  style="width: 100%"
                  :picker-options="{ selectableRange: '00:00:00-23:59:00' }"
                  format="HH:mm"
                  value-format="HH:mm"
                  v-model="form.chuncdsj6"
                  @change="handleTimeS(5, form.chuncdsj6)"
                  @paste.native="handlePasteTwo($event, 0, 5)"
                /> -->
              </td>
              <td style="width: calc(80% / 11 * 1)">
                <el-input v-model="form.chuncdsj7" @change="handleTimeSInput(6, form.chuncdsj7)" />

                <!-- <el-time-picker
                  class="hide-icon"
                  style="width: 100%"
                  :picker-options="{ selectableRange: '00:00:00-23:59:00' }"
                  format="HH:mm"
                  value-format="HH:mm"
                  v-model="form.chuncdsj7"
                  @change="handleTimeS(6, form.chuncdsj7)"
                  @paste.native="handlePasteTwo($event, 0, 6)"
                /> -->
              </td>
              <td style="width: calc(80% / 11 * 1)">
                <el-input v-model="form.chuncdsj8" @change="handleTimeSInput(7, form.chuncdsj8)" />
                <!-- <el-time-picker
                  class="hide-icon"
                  style="width: 100%"
                  :picker-options="{ selectableRange: '00:00:00-23:59:00' }"
                  format="HH:mm"
                  value-format="HH:mm"
                  v-model="form.chuncdsj8"
                  @change="handleTimeS(7, form.chuncdsj8)"
                  @paste.native="handlePasteTwo($event, 0, 7)"
                /> -->
              </td>
              <td style="width: calc(80% / 11 * 1)">
                <el-input v-model="form.chuncdsj9" @change="handleTimeSInput(8, form.chuncdsj9)" />
                <!-- <el-time-picker
                  class="hide-icon"
                  style="width: 100%"
                  :picker-options="{ selectableRange: '00:00:00-23:59:00' }"
                  format="HH:mm"
                  value-format="HH:mm"
                  v-model="form.chuncdsj9"
                  @change="handleTimeS(8, form.chuncdsj9)"
                  @paste.native="handlePasteTwo($event, 0, 8)"
                /> -->
              </td>
              <td style="width: calc(80% / 11 * 1)">
                <el-input v-model="form.chuncdsj10" @change="handleTimeSInput(9, form.chuncdsj10)" />
                <!-- <el-time-picker
                  class="hide-icon"
                  style="width: 100%"
                  :picker-options="{ selectableRange: '00:00:00-23:59:00' }"
                  format="HH:mm"
                  value-format="HH:mm"
                  v-model="form.chuncdsj10"
                  @change="handleTimeS(9, form.chuncdsj10)"
                  @paste.native="handlePasteTwo($event, 0, 9)"
                /> -->
              </td>
              <td style="width: calc(80% / 11 * 1)">
                <el-input v-model="form.chuncdsj11" @change="handleTimeSInput(10, form.chuncdsj11)" />

                <!-- <el-time-picker
                  class="hide-icon"
                  style="width: 100%"
                  :picker-options="{ selectableRange: '00:00:00-23:59:00' }"
                  format="HH:mm"
                  value-format="HH:mm"
                  v-model="form.chuncdsj11"
                  @change="handleTimeS(10, form.chuncdsj11)"
                  @paste.native="handlePasteTwo($event, 0, 10)"
                /> -->
              </td>
            </tr>
            <tr height="60">
              <td>
                试杆距底
                <br />板距离 <br />(mm)
              </td>
              <td>
                <el-input type="number" v-model="form.chuncdjl1" @keydown.native="handleKeyDown($event, 1, 0)" @paste.native="handlePasteTwo($event, 1, 0)" :ref="'1_0'" />
              </td>
              <td>
                <el-input type="number" v-model="form.chuncdjl2" @keydown.native="handleKeyDown($event, 1, 1)" @paste.native="handlePasteTwo($event, 1, 1)" :ref="'1_1'" />
              </td>
              <td>
                <el-input type="number" v-model="form.chuncdjl3" @keydown.native="handleKeyDown($event, 1, 2)" @paste.native="handlePasteTwo($event, 1, 2)" :ref="'1_2'" />
              </td>
              <td>
                <el-input type="number" v-model="form.chuncdjl4" @keydown.native="handleKeyDown($event, 1, 3)" @paste.native="handlePasteTwo($event, 1, 3)" :ref="'1_3'" />
              </td>
              <td>
                <el-input type="number" v-model="form.chuncdjl5" @keydown.native="handleKeyDown($event, 1, 4)" @paste.native="handlePasteTwo($event, 1, 4)" :ref="'1_4'" />
              </td>
              <td>
                <el-input type="number" v-model="form.chuncdjl6" @keydown.native="handleKeyDown($event, 1, 5)" @paste.native="handlePasteTwo($event, 1, 5)" :ref="'1_5'" />
              </td>
              <td>
                <el-input type="number" v-model="form.chuncdjl7" @keydown.native="handleKeyDown($event, 1, 6)" @paste.native="handlePasteTwo($event, 1, 6)" :ref="'1_6'" />
              </td>
              <td>
                <el-input type="number" v-model="form.chuncdjl8" @keydown.native="handleKeyDown($event, 1, 7)" @paste.native="handlePasteTwo($event, 1, 7)" :ref="'1_7'" />
              </td>
              <td>
                <el-input type="number" v-model="form.chuncdjl9" @keydown.native="handleKeyDown($event, 1, 8)" @paste.native="handlePasteTwo($event, 1, 8)" :ref="'1_8'" />
              </td>
              <td>
                <el-input type="number" v-model="form.chuncdjl10" @keydown.native="handleKeyDown($event, 1, 9)" @paste.native="handlePasteTwo($event, 1, 9)" :ref="'1_9'" />
              </td>
              <td>
                <el-input type="number" v-model="form.chuncdjl11" @keydown.native="handleKeyDown($event, 1, 10)" @paste.native="handlePasteTwo($event, 1, 10)" :ref="'1_10'" />
              </td>
            </tr>
            <tr height="60">
              <td rowspan="2">终凝测定</td>
              <td>
                测试
                <br />时间 <br />(h:min)
              </td>
              <td>
                <el-input v-model="form.zhongncdsj1" @change="handleTimeEInput(0, form.zhongncdsj1)" />

                <!-- <el-time-picker
                  class="hide-icon"
                  style="width: 100%"
                  :picker-options="{ selectableRange: '00:00:00-23:59:00' }"
                  format="HH:mm"
                  value-format="HH:mm"
                  v-model="form.zhongncdsj1"
                  @change="handleTimeE(0, form.zhongncdsj1)"
                  @paste.native="handlePasteTwo($event, 2, 0)"
                /> -->
              </td>
              <td>
                <el-input v-model="form.zhongncdsj2" @change="handleTimeEInput(1, form.zhongncdsj2)" />
                <!-- <el-time-picker
                  class="hide-icon"
                  style="width: 100%"
                  :picker-options="{ selectableRange: '00:00:00-23:59:00' }"
                  format="HH:mm"
                  value-format="HH:mm"
                  v-model="form.zhongncdsj2"
                  @change="handleTimeE(1, form.zhongncdsj2)"
                  @paste.native="handlePasteTwo($event, 2, 1)"
                /> -->
              </td>
              <td>
                <el-input v-model="form.zhongncdsj3" @change="handleTimeEInput(2, form.zhongncdsj3)" />

                <!-- <el-time-picker
                  class="hide-icon"
                  style="width: 100%"
                  :picker-options="{ selectableRange: '00:00:00-23:59:00' }"
                  format="HH:mm"
                  value-format="HH:mm"
                  v-model="form.zhongncdsj3"
                  @change="handleTimeE(2, form.zhongncdsj3)"
                  @paste.native="handlePasteTwo($event, 2, 2)"
                /> -->
              </td>
              <td>
                <el-input v-model="form.zhongncdsj4" @change="handleTimeEInput(3, form.zhongncdsj4)" />

                <!-- <el-time-picker
                  class="hide-icon"
                  style="width: 100%"
                  :picker-options="{ selectableRange: '00:00:00-23:59:00' }"
                  format="HH:mm"
                  value-format="HH:mm"
                  v-model="form.zhongncdsj4"
                  @change="handleTimeE(3, form.zhongncdsj4)"
                  @paste.native="handlePasteTwo($event, 2, 3)"
                /> -->
              </td>
              <td>
                <el-input v-model="form.zhongncdsj5" @change="handleTimeEInput(4, form.zhongncdsj5)" />

                <!-- <el-time-picker
                  class="hide-icon"
                  style="width: 100%"
                  :picker-options="{ selectableRange: '00:00:00-23:59:00' }"
                  format="HH:mm"
                  value-format="HH:mm"
                  v-model="form.zhongncdsj5"
                  @change="handleTimeE(4, form.zhongncdsj5)"
                  @paste.native="handlePasteTwo($event, 2, 4)"
                /> -->
              </td>
              <td>
                <el-input v-model="form.zhongncdsj6" @change="handleTimeEInput(5, form.zhongncdsj6)" />

                <!-- <el-time-picker
                  class="hide-icon"
                  style="width: 100%"
                  :picker-options="{ selectableRange: '00:00:00-23:59:00' }"
                  format="HH:mm"
                  value-format="HH:mm"
                  v-model="form.zhongncdsj6"
                  @change="handleTimeE(5, form.zhongncdsj6)"
                  @paste.native="handlePasteTwo($event, 2, 5)"
                /> -->
              </td>
              <td>
                <el-input v-model="form.zhongncdsj7" @change="handleTimeEInput(6, form.zhongncdsj7)" />
                <!-- <el-time-picker
                  class="hide-icon"
                  style="width: 100%"
                  :picker-options="{ selectableRange: '00:00:00-23:59:00' }"
                  format="HH:mm"
                  value-format="HH:mm"
                  v-model="form.zhongncdsj7"
                  @change="handleTimeE(6, form.zhongncdsj7)"
                  @paste.native="handlePasteTwo($event, 2, 6)"
                /> -->
              </td>
              <td>
                <el-input v-model="form.zhongncdsj8" @change="handleTimeEInput(7, form.zhongncdsj8)" />

                <!-- <el-time-picker
                  class="hide-icon"
                  style="width: 100%"
                  :picker-options="{ selectableRange: '00:00:00-23:59:00' }"
                  format="HH:mm"
                  value-format="HH:mm"
                  v-model="form.zhongncdsj8"
                  @change="handleTimeE(7, form.zhongncdsj8)"
                  @paste.native="handlePasteTwo($event, 2, 7)"
                /> -->
              </td>
              <td>
                <el-input v-model="form.zhongncdsj9" @change="handleTimeEInput(8, form.zhongncdsj9)" />

                <!-- <el-time-picker
                  class="hide-icon"
                  style="width: 100%"
                  :picker-options="{ selectableRange: '00:00:00-23:59:00' }"
                  format="HH:mm"
                  value-format="HH:mm"
                  v-model="form.zhongncdsj9"
                  @change="handleTimeE(8, form.zhongncdsj9)"
                  @paste.native="handlePasteTwo($event, 2, 8)"
                /> -->
              </td>
              <td>
                <el-input v-model="form.zhongncdsj10" @change="handleTimeEInput(9, form.zhongncdsj10)" />

                <!-- <el-time-picker
                  class="hide-icon"
                  style="width: 100%"
                  :picker-options="{ selectableRange: '00:00:00-23:59:00' }"
                  format="HH:mm"
                  value-format="HH:mm"
                  v-model="form.zhongncdsj10"
                  @change="handleTimeE(9, form.zhongncdsj10)"
                  @paste.native="handlePasteTwo($event, 2, 9)"
                /> -->
              </td>
              <td>
                <el-input v-model="form.zhongncdsj11" @change="handleTimeEInput(10, form.zhongncdsj11)" />

                <!-- <el-time-picker
                  class="hide-icon"
                  style="width: 100%"
                  :picker-options="{ selectableRange: '00:00:00-23:59:00' }"
                  format="HH:mm"
                  value-format="HH:mm"
                  v-model="form.zhongncdsj11"
                  @change="handleTimeE(10, form.zhongncdsj11)"
                  @paste.native="handlePasteTwo($event, 2, 10)"
                /> -->
              </td>
            </tr>
            <tr height="60">
              <td>读数（mm）</td>
              <td>
                <el-input type="text" v-model="form.zhongncdhx1" @keydown.native="handleKeyDown($event, 2, 0)" @paste.native="handlePasteTwo($event, 3, 0)" :ref="'2_0'" />
              </td>
              <td>
                <el-input type="text" v-model="form.zhongncdhx2" @keydown.native="handleKeyDown($event, 2, 1)" @paste.native="handlePasteTwo($event, 3, 1)" :ref="'2_1'" />
              </td>
              <td>
                <el-input type="text" v-model="form.zhongncdhx3" @keydown.native="handleKeyDown($event, 2, 2)" @paste.native="handlePasteTwo($event, 3, 2)" :ref="'2_2'" />
              </td>
              <td>
                <el-input type="text" v-model="form.zhongncdhx4" @keydown.native="handleKeyDown($event, 2, 3)" @paste.native="handlePasteTwo($event, 3, 3)" :ref="'2_3'" />
              </td>
              <td>
                <el-input type="text" v-model="form.zhongncdhx5" @keydown.native="handleKeyDown($event, 2, 4)" @paste.native="handlePasteTwo($event, 3, 4)" :ref="'2_4'" />
              </td>
              <td>
                <el-input type="text" v-model="form.zhongncdhx6" @keydown.native="handleKeyDown($event, 2, 5)" @paste.native="handlePasteTwo($event, 3, 5)" :ref="'2_5'" />
              </td>
              <td>
                <el-input type="text" v-model="form.zhongncdhx7" @keydown.native="handleKeyDown($event, 2, 6)" @paste.native="handlePasteTwo($event, 3, 6)" :ref="'2_6'" />
              </td>
              <td>
                <el-input type="text" v-model="form.zhongncdhx8" @keydown.native="handleKeyDown($event, 2, 7)" @paste.native="handlePasteTwo($event, 3, 7)" :ref="'2_7'" />
              </td>
              <td>
                <el-input type="text" v-model="form.zhongncdhx9" @keydown.native="handleKeyDown($event, 2, 8)" @paste.native="handlePasteTwo($event, 3, 8)" :ref="'2_8'" />
              </td>
              <td>
                <el-input type="text" v-model="form.zhongncdhx10" @keydown.native="handleKeyDown($event, 2, 9)" @paste.native="handlePasteTwo($event, 3, 9)" :ref="'2_9'" />
              </td>
              <td>
                <el-input type="text" v-model="form.zhongncdhx11" @keydown.native="handleKeyDown($event, 2, 10)" @paste.native="handlePasteTwo($event, 3, 10)" :ref="'2_10'" />
              </td>
            </tr>
            <tr height="25">
              <td colspan="3">初凝时间（min）</td>
              <td colspan="3">
                <span>{{ form.ningjsjcnsj }}</span>
              </td>
              <td colspan="4">终凝时间（min）</td>
              <td colspan="3">
                <span>{{ form.ningjsjznsj }}</span>
              </td>
            </tr>
            <tr height="25">
              <td rowspan="7">
                安
                <br />定 <br />法
              </td>
              <td rowspan="3">
                试
                <br />饼 <br />法
              </td>
              <td colspan="2">制件日期</td>
              <td colspan="2">测定日期</td>
              <td colspan="8">试件蒸煮/压蒸前后情况</td>
            </tr>
            <tr height="25">
              <td rowspan="2" colspan="2">
                <el-date-picker class="syrqStyle" v-model="form.shibfzjrq" style="width: 100%" />
              </td>
              <td rowspan="2" colspan="2">
                <el-date-picker class="syrqStyle" v-model="form.shibfcdrq" style="width: 100%" />
              </td>
              <td colspan="8">
                <el-input type="text" v-model="form.shibfqk" @keydown.native="handleKeyDown($event, 3, 0)" @paste.native="handlePasteThree($event, 0, 0)" :ref="'3_0'" />
              </td>
            </tr>
            <tr height="25">
              <td colspan="8">
                <el-input type="text" v-model="form.shibfqk2" @keydown.native="handleKeyDown($event, 4, 0)" @paste.native="handlePasteThree($event, 1, 0)" :ref="'4_0'" />
              </td>
            </tr>
            <tr height="25">
              <td rowspan="4">
                雷
                <br />氏 <br />法
              </td>
              <td rowspan="2" colspan="2">制件日期</td>
              <td rowspan="2" colspan="2">测定日期</td>
              <td rowspan="2" colspan="2">A值（mm）</td>
              <td rowspan="2" colspan="2">C值（mm）</td>
              <td colspan="4">C-A值（mm）</td>
            </tr>
            <tr height="25">
              <td colspan="2">单值</td>
              <td colspan="2">平均值</td>
            </tr>
            <tr height="25">
              <td rowspan="2" colspan="2">
                <el-date-picker class="syrqStyle" v-model="form.leisfzjrq" style="width: 100%" />
              </td>
              <td rowspan="2" colspan="2">
                <el-date-picker class="syrqStyle" v-model="form.leisfcdrq" style="width: 100%" />
              </td>
              <td colspan="2">
                <el-input type="number" v-model="form.leisfaz1" @change="calculateLsf1()" @keydown.native="handleKeyDown($event, 5, 0)" @paste.native="handlePasteFour($event, 0, 0)" :ref="'5_0'" />
              </td>
              <td colspan="2">
                <el-input type="number" v-model="form.leisfcz1" @change="calculateLsf1()" @keydown.native="handleKeyDown($event, 5, 1)" @paste.native="handlePasteFour($event, 0, 1)" :ref="'5_1'" />
              </td>
              <td colspan="2">
                <span>{{ form.leisfdanz1 }}</span>
              </td>
              <td rowspan="2" colspan="2">
                <span>{{ form.leisfpingjz }}</span>
              </td>
            </tr>
            <tr height="25">
              <td colspan="2">
                <el-input type="number" v-model="form.leisfaz2" @change="calculateLsf2()" @keydown.native="handleKeyDown($event, 6, 0)" @paste.native="handlePasteFour($event, 1, 0)" :ref="'6_0'" />
              </td>
              <td colspan="2">
                <el-input type="number" v-model="form.leisfcz2" @change="calculateLsf2()" @keydown.native="handleKeyDown($event, 6, 1)" @paste.native="handlePasteFour($event, 1, 1)" :ref="'6_1'" />
              </td>
              <td colspan="2">
                <span>{{ form.leisfdanz2 }}</span>
              </td>
            </tr>
          </tbody>
        </table>
        <!------------------------------附加声明-------------------------->
        <table height="30px" class="bottom-table">
          <tr>
            <td>
              <span v-if="isPdf" class="textarea-span">{{ form.fujsm }}</span>
              <el-input v-else type="textarea" :rows="2" v-model="form.fujsm" @focus="handleFocus('fujsm')" />
            </td>
          </tr>
        </table>
      </div>
      <!------------------------------表底-------------------------->
      <table height="22px" class="transparent">
        <tbody>
          <tr>
            <td width="10%" align="right">检测：</td>
            <td width="15%" align="left"></td>
            <td width="10%" align="right">记录：</td>
            <td width="15%" align="left"></td>
            <td width="10%" align="right">复核：</td>
            <td align="left" width="15%"></td>
            <td width="10%">日期：</td>
            <td align="left" width="15%">
              <div style="display: inline-block; margin-left: 20px">年</div>
              <div style="display: inline-block; margin-left: 20px">月</div>
              <div style="display: inline-block; margin-left: 20px">日</div>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
    <bs-instrument-view ref="bsInstrumentViewRef" @select="selectInstrument"></bs-instrument-view>
    <bs-jiancyj-view ref="bsJiancyjViewRef" @select="selectJiancyj" :syType="syType"></bs-jiancyj-view>
    <bs-judge-base-view ref="bsJudgeBaseViewRef" @select="selectJudge" :syType="syType"></bs-judge-base-view>
  </div>
</template>

<script>
import { getSnbzjcjlbBsInfo } from "@/api/report_sn/snbzjcjlbBsInfo";
import BsInstrumentView from "@/views/dept/bsInstrument/BsInstrumentView.vue";
import BsJiancyjView from "@/views/sycs/bsJiancyj/BsJiancyjView.vue";
import { emptyConvert, handleFocus, handleKeyDown, handlePaste } from "@/views/reportForms/utils";
import BsJudgeBaseView from "@/views/sycs/bsJudgeBase/BsJudgeBaseView.vue";
import Bus from "@/utils/bus";
import decimal from "@/utils/big-decimal";
import { dictKey, setBljw, getDecimalWs } from "../components/decimalScheme.js";

export default {
  name: "snbzjcjlb",
  components: {
    BsInstrumentView,
    BsJiancyjView,
    BsJudgeBaseView
  },
  props: {
    excelId: {
      type: [String, Number],
      default: () => ""
    },
    syType: {
      type: [String, Number],
      default: () => ""
    },
    page: {
      type: Number,
      default: () => 0
    },
    isPdf: {
      type: Boolean,
      default: () => false
    },
    printEmpty: {
      type: Boolean,
      default: () => false
    }
  },
  data() {
    return {
      params: {},
      query: {},
      // 表单参数
      form: {},
      timeS: [null, null, null, null, null, null, null, null, null, null, null, null],
      timeE: [null, null, null, null, null, null, null, null, null, null, null, null],
      // 表单校验
      rules: {
        excelId: [{ required: true, message: "主键不能为空", trigger: "blur" }]
      },
      detailVos: []
    };
  },

  created() {
    this.getInfo();
  },
  mounted() {
    // 检测依据
    Bus.$on("setXsd", (data) => {
      this.getInfo();
      this.$modal.msgSuccess("设使用成功");
    });
  },
  beforeDestroy() {
    // 或者你可以使用其他合适的生命周期钩子
    // 停止监听事件
    Bus.$off("setXsd");
  },
  methods: {
    setBljw,
    getDecimalWs,
    // 获取详情
    getInfo() {
      getSnbzjcjlbBsInfo(this.excelId || this.$defaultExcelId).then((response) => {
        this.form = response.data;
        this.detailVos = this.setBljw(response.data.fanganVo?.detailVos || []);
        if (this.detailVos?.length) {
          this.setXsdFA();
        }

        if (!this.form.fujsm) {
          this.form.fujsm = "附加声明：";
        }
      });
    },

    // 显示检测依据列表
    showBsJiancyjView() {
      this.$refs.bsJiancyjViewRef.init(this.form.jiancyjIds);
    },
    // 检测依据选择
    selectJiancyj(info) {
      this.form.jiancyj = info.label;
      this.form.jiancyjIds = info.ids;
      Bus.$emit("setSnBgJiancyj", { jiancyj: this.form.jiancyj, jiancyjIds: this.form.jiancyjIds });
    },

    // 显示判定依据列表
    showBsJudgeBaseView() {
      this.$refs.bsJudgeBaseViewRef.init(this.form.pandyjIds);
    },
    // 判断依据选择
    selectJudge(info) {
       this.form.pandyjIds = info.ids;
      this.form.pandyj = info.label;
    },

    // 显示仪器列表
    showBsInstrumentView() {
      this.$refs.bsInstrumentViewRef.init(this.form.shebIds);
    },
    // 仪器选择
    selectInstrument(info) {
      this.form.zhuyyqsbmcjbh = info.label;
      this.form.shebIds = info.ids;
      Bus.$emit("setSnBgZhuyyqsbmcjbh", { zhuyyqsbmcjbh: this.form.zhuyyqsbmcjbh, shebIds: this.form.shebIds });
    },

    handleFocus(event) {
      handleFocus(event, this.page, this.form[event]);
    },

    //计算标准稠度用水量
    calculateYsl() {
      let num = this.getDecimalWs(this.detailVos, "biaozcdyslbzcdysl", 1);

      // 标准稠度用水量
      Bus.$emit("setSNBgJiancjg", [
        {
          key: 74,
          value: decimal.divide(decimal.multiply(this.form.biaozcdysljsl, 100), this.form.biaozcdyslsyzl, num)
        }
      ]);
      return (this.form.biaozcdyslbzcdysl = decimal.divide(decimal.multiply(this.form.biaozcdysljsl, 100), this.form.biaozcdyslsyzl, num));
    },
    handleStartTime(v) {
      if (this.isValidTime(v)) {
        for (let i = 1; i < 12; i++) {
          if (this.form["chuncdsj" + i] != null) {
            this.timeS[i] = this.convertToTimestamp(this.form["chuncdsj" + i]);
          }
        }
        let arrS = [];
        arrS = this.timeS.filter((v) => v != null);
        this.form.ningjsjcnsj = arrS[arrS.length - 1] - this.convertToTimestamp(v);
        for (let i = 1; i < 12; i++) {
          if (this.form["zhongncdsj" + i] != null) {
            this.timeE[i] = this.convertToTimestamp(this.form["zhongncdsj" + i]);
          }
        }
        let arrE = [];
        arrE = this.timeE.filter((v) => v != null);
        this.form.ningjsjznsj = arrE[arrE.length - 1] - this.convertToTimestamp(v);
      } else {
        this.$message.warning(`您的开始加水时间(h:min)输入格式错误！`);
      }
    },
    handleTimeS(index, v) {
      if (this.form.ningjsjksjssj != null) {
        let kssj = this.convertToTimestamp(this.form.ningjsjksjssj);
        for (let i = 1; i < 12; i++) {
          if (this.form["chuncdsj" + i] != null) {
            this.timeS[i] = this.convertToTimestamp(this.form["chuncdsj" + i]);
          }
        }
        let arrS = [];
        arrS = this.timeS.filter((v) => v != null);
        this.form.ningjsjcnsj = arrS[arrS.length - 1] - kssj;
      }
    },
    handleTimeSInput(index, v) {
      if (this.form.ningjsjksjssj != null) {
        let kssj = this.convertToTimestamp(this.form.ningjsjksjssj);
        // let isHM = this.isValidTime(v);
        if (this.isValidTime(v)) {
          for (let i = 1; i < 12; i++) {
            if (this.form["chuncdsj" + i] != null) {
              this.timeS[i] = this.convertToTimestamp(this.form["chuncdsj" + i]);
            }
          }
          let arrS = [];
          arrS = this.timeS.filter((v) => v != null);
          this.form.ningjsjcnsj = arrS[arrS.length - 1] - kssj;
        } else {
          this.$message.warning(`您的初凝测定中第${index + 1}个测试时间输入格式错误！`);
        }
      }
    },
    handleTimeE(index, v) {
      if (this.form.ningjsjksjssj != null) {
        let kssj = this.convertToTimestamp(this.form.ningjsjksjssj);
        for (let i = 1; i < 12; i++) {
          if (this.form["zhongncdsj" + i] != null) {
            this.timeE[i] = this.convertToTimestamp(this.form["zhongncdsj" + i]);
          }
        }
        let arrE = [];
        arrE = this.timeE.filter((v) => v != null);
        this.form.ningjsjznsj = arrE[arrE.length - 1] - kssj;
      }
    },
    handleTimeEInput(index, v) {
      if (this.form.ningjsjksjssj != null) {
        let kssj = this.convertToTimestamp(this.form.ningjsjksjssj);
        // let isHM = this.isValidTime(v);
        if (this.isValidTime(v)) {
          for (let i = 1; i < 12; i++) {
            if (this.form["zhongncdsj" + i] != null) {
              this.timeE[i] = this.convertToTimestamp(this.form["zhongncdsj" + i]);
            }
          }
          let arrE = [];
          arrE = this.timeE.filter((v) => v != null);
          this.form.ningjsjznsj = arrE[arrE.length - 1] - kssj;
        } else {
          this.$message.warning(`您的终凝测定中第${index + 1}个测试时间输入格式错误！`);
        }
      }
    },

    isValidTime(timeStr) {
      // 定义正则表达式
      const timePattern = /^(2[0-3]|[01]?[0-9]):([0-5]?[0-9])$/;
      // 测试输入字符串是否匹配正则表达式
      return timePattern.test(timeStr);
    },
    convertToTimestamp(timeStr) {
      const parts = timeStr.split(":");
      const hours = parseInt(parts[0], 10);
      const minutes = parseInt(parts[1].replace("min", ""), 10);
      const timestamp = hours * 60 + minutes;
      return timestamp; // 如果需要秒为单位，除以1000
    },

    //计算雷氏法1
    calculateLsf1() {
      let num = this.getDecimalWs(this.detailVos, "leisfdanz1", 1);
      this.form.leisfdanz1 = decimal.subtract(this.form.leisfcz1, this.form.leisfaz1, num);

      const leisfdanz1 = Number(this.form.leisfdanz1);
      const leisfdanz2 = Number(this.form.leisfdanz2);
      let a = decimal.add(leisfdanz1, leisfdanz2);
      if (!leisfdanz1 || !leisfdanz2) {
        this.form.leisfpingjz = "";
        return;
      }
      let leisfpingjzWs = this.getDecimalWs(this.detailVos, "leisfpingjz", 1);
      this.form.leisfpingjz = decimal.round(a / 2, leisfpingjzWs);
      // 试饼法
      Bus.$emit("setSNBgJiancjg", [{ key: 77, value: "" }]);
      // 雷氏法
      Bus.$emit("setSNBgJiancjg", [{ key: 78, value: this.form.leisfpingjz }]);
    },
    //计算雷氏法2
    calculateLsf2() {
      let num = this.getDecimalWs(this.detailVos, "leisfdanz2", 1);

      this.form.leisfdanz2 = decimal.subtract(this.form.leisfcz2, this.form.leisfaz2, num);
      const leisfdanz1 = Number(this.form.leisfdanz1);
      const leisfdanz2 = Number(this.form.leisfdanz2);
      let a = decimal.add(leisfdanz1, leisfdanz2);
      if (!leisfdanz1 || !leisfdanz2) {
        this.form.leisfpingjz = "";
        return;
      }
      let leisfpingjzWs = this.getDecimalWs(this.detailVos, "leisfpingjz", 1);
      this.form.leisfpingjz = decimal.round(a / 2, leisfpingjzWs);
      // 试饼法
      Bus.$emit("setSNBgJiancjg", [{ key: 77, value: "" }]);
      // 雷氏法
      Bus.$emit("setSNBgJiancjg", [{ key: 78, value: this.form.leisfpingjz }]);
    },
    submitForm() {
      return this.form;
    },
    handleKeyDown(event, rowIndex, colIndex) {
      const maxArr = [2, 10, 10, 0, 0, 1, 1]; // 每一行最多有多少可聚焦输入框（从0开始）
      const ref = handleKeyDown(event, rowIndex, colIndex, maxArr);
      if (this.$refs[ref]) {
        this.$refs[ref].focus();
      }
    },
    // 粘贴赋值方法-标准稠度用水量
    handlePaste(event, rowIndex, colIndex) {
      const nameAllArr = [["biaozcdyslsyzl", "biaozcdysljsl", "biaozcdyslsgxcdbjl"]];
      const subscriptArr = [[0, 1, 2]];

      const methodsAllArr = [[null, "calculateYsl", null]];
      const parameterArr = [[null, null, null]];
      const data = handlePaste(event, rowIndex, colIndex, nameAllArr, methodsAllArr, parameterArr, subscriptArr);
      const { cols, nameSetArr, methodsSetArr, parameterSetArr, subscriptSetArr } = data;
      for (let a = 0; a < nameSetArr.length; a++) {
        for (let b = 0; b < nameSetArr[a].length; b++) {
          this.form[nameSetArr[a][b]] = cols[a][b];
        }
      }
      for (let a = 0; a < methodsSetArr.length; a++) {
        for (let b = 0; b < methodsSetArr[a].length; b++) {
          if (methodsSetArr[a][b]) {
            this.setCalculate(methodsSetArr[a][b], parameterSetArr[a][b]);
          }
        }
      }
    },

    // 粘贴赋值方法-凝结时间
    handlePasteTwo(event, rowIndex, colIndex) {
      const nameAllArr = [
        ["chuncdsj1", "chuncdsj2", "chuncdsj3", "chuncdsj4", "chuncdsj5", "chuncdsj6", "chuncdsj7", "chuncdsj8", "chuncdsj9", "chuncdsj10", "chuncdsj11"],
        ["chuncdjl1", "chuncdjl2", "chuncdjl3", "chuncdjl4", "chuncdjl5", "chuncdjl6", "chuncdjl7", "chuncdjl8", "chuncdjl9", "chuncdjl10", "chuncdjl11"],
        ["zhongncdsj1", "zhongncdsj2", "zhongncdsj3", "zhongncdsj4", "zhongncdsj5", "zhongncdsj6", "zhongncdsj7", "zhongncdsj8", "zhongncdsj9", "zhongncdsj10", "zhongncdsj11"],
        ["zhongncdhx1", "zhongncdhx2", "zhongncdhx3", "zhongncdhx4", "zhongncdhx5", "zhongncdhx6", "zhongncdhx7", "zhongncdhx8", "zhongncdhx9", "zhongncdhx10", "zhongncdhx11"]
      ];
      const subscriptArr = [
        [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
        [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
        [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
        [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
      ];

      const methodsAllArr = [
        ["handleTimeS", "handleTimeS", "handleTimeS", "handleTimeS", "handleTimeS", "handleTimeS", "handleTimeS", "handleTimeS", "handleTimeS", "handleTimeS", "handleTimeS"],
        [null, null, null, null, null, null, null, null, null, null, null],
        ["handleTimeE", "handleTimeE", "handleTimeE", "handleTimeE", "handleTimeE", "handleTimeE", "handleTimeE", "handleTimeE", "handleTimeE", "handleTimeE", "handleTimeE"],
        [null, null, null, null, null, null, null, null, null, null, null]
      ];
      const parameterArr = [
        [
          "0-" + this.form.chuncdsj1,
          "1-" + this.form.chuncdsj2,
          "2-" + this.form.chuncdsj3,
          "3-" + this.form.chuncdsj4,
          "4-" + this.form.chuncdsj5,
          "5-" + this.form.chuncdsj6,
          "6-" + this.form.chuncdsj7,
          "7-" + this.form.chuncdsj8,
          "8-" + this.form.chuncdsj9,
          "9-" + this.form.chuncdsj10,
          "10-" + this.form.chuncdsj11
        ],
        [null, null, null, null, null, null, null, null, null, null, null],
        [
          "0-" + this.form.zhongncdsj1,
          "1-" + this.form.zhongncdsj2,
          "2-" + this.form.zhongncdsj3,
          "3-" + this.form.zhongncdsj4,
          "4-" + this.form.zhongncdsj5,
          "5-" + this.form.zhongncdsj6,
          "6-" + this.form.zhongncdsj7,
          "7-" + this.form.zhongncdsj8,
          "8-" + this.form.zhongncdsj9,
          "9-" + this.form.zhongncdsj10,
          "10-" + this.form.zhongncdsj11
        ],
        [null, null, null, null, null, null, null, null, null, null, null]
      ];
      const data = handlePaste(event, rowIndex, colIndex, nameAllArr, methodsAllArr, parameterArr, subscriptArr);
      const { cols, nameSetArr, methodsSetArr, parameterSetArr, subscriptSetArr } = data;
      for (let a = 0; a < nameSetArr.length; a++) {
        for (let b = 0; b < nameSetArr[a].length; b++) {
          this.form[nameSetArr[a][b]] = cols[a][b];
        }
      }
      for (let a = 0; a < methodsSetArr.length; a++) {
        for (let b = 0; b < methodsSetArr[a].length; b++) {
          let methods = methodsSetArr[a][b];
          if (methods) {
            if (methods === "handleTimeS" || methods === "handleTimeE") {
              let parameter = parameterSetArr[a][b];
              let parameterArr = parameter ? parameter.split("-") : [];
              if (parameterArr.length >= 2) {
                this.setCalculate(methodsSetArr[a][b], parameterArr[0], parameterArr[1]);
              }
            } else {
              this.setCalculate(methodsSetArr[a][b], parameterSetArr[a][b]);
            }
          }
        }
      }
    },

    // 粘贴赋值方法-试饼法
    handlePasteThree(event, rowIndex, colIndex) {
      const nameAllArr = [["shibfqk"], ["shibfqk2"]];
      const subscriptArr = [[0], [0]];

      const methodsAllArr = [];
      const parameterArr = [];
      const data = handlePaste(event, rowIndex, colIndex, nameAllArr, methodsAllArr, parameterArr, subscriptArr);
      const { cols, nameSetArr, methodsSetArr, parameterSetArr, subscriptSetArr } = data;
      for (let a = 0; a < nameSetArr.length; a++) {
        for (let b = 0; b < nameSetArr[a].length; b++) {
          this.form[nameSetArr[a][b]] = cols[a][b];
        }
      }
      for (let a = 0; a < methodsSetArr.length; a++) {
        for (let b = 0; b < methodsSetArr[a].length; b++) {
          if (methodsSetArr[a][b]) {
            this.setCalculate(methodsSetArr[a][b], parameterSetArr[a][b]);
          }
        }
      }
    },

    // 粘贴赋值方法-雷试法
    handlePasteFour(event, rowIndex, colIndex) {
      const nameAllArr = [
        ["leisfaz1", "leisfcz1"],
        ["leisfaz2", "leisfcz2"]
      ];
      const subscriptArr = [
        [0, 1],
        [0, 1]
      ];

      const methodsAllArr = [
        ["calculateLsf1", "calculateLsf1"],
        ["calculateLsf2", "calculateLsf2"]
      ];
      const parameterArr = [
        [null, null],
        [null, null]
      ];
      const data = handlePaste(event, rowIndex, colIndex, nameAllArr, methodsAllArr, parameterArr, subscriptArr);
      const { cols, nameSetArr, methodsSetArr, parameterSetArr, subscriptSetArr } = data;
      for (let a = 0; a < nameSetArr.length; a++) {
        for (let b = 0; b < nameSetArr[a].length; b++) {
          this.form[nameSetArr[a][b]] = cols[a][b];
        }
      }
      for (let a = 0; a < methodsSetArr.length; a++) {
        for (let b = 0; b < methodsSetArr[a].length; b++) {
          if (methodsSetArr[a][b]) {
            this.setCalculate(methodsSetArr[a][b], parameterSetArr[a][b]);
          }
        }
      }
    },

    // 计算方法调用
    setCalculate(name, a, b, c, d, e) {
      this[name](a, b, c, d, e);
    },
    // 小数点方案使用调用方法
    setXsdFA() {
      const methodsAllArr = ["calculateYsl", "calculateLsf1", "calculateLsf2"];
      for (let a = 0; a < methodsAllArr.length; a++) {
        this.setCalculate(methodsAllArr[a]);
      }
    }
  }
};
</script>

<style lang="scss">
.syrqStyle {
  .el-icon-date {
    display: none !important;
  }
}
</style>
